import request from '@/utils/request'

// 查询班次排班列表
export function listSchedule(query) {
  return request({
    url: '/sm/schedule/list',
    method: 'get',
    params: query
  })
}

// 查询班次排班详细
export function getSchedule(scheduleId) {
  return request({
    url: '/sm/schedule/' + scheduleId,
    method: 'get'
  })
}

// 新增班次排班
export function addSchedule(data) {
  return request({
    url: '/sm/schedule',
    method: 'post',
    data: data
  })
}

// 修改班次排班
export function updateSchedule(data) {
  return request({
    url: '/sm/schedule',
    method: 'put',
    data: data
  })
}

// 删除班次排班
export function delSchedule(scheduleId) {
  return request({
    url: '/sm/schedule/' + scheduleId,
    method: 'delete'
  })
}

// 生产线不分页
export function listLine(query) {
  return request({
    url: '/pm/plan/line/getlist',
    method: 'get',
    params: query
  })
}

// 所属车间不分页
export function listWorkshop(query) {
  return request({
     url: '/bdm/line/workshop/getlist',
     method: 'get',
     params: query
   })
 }

 // 所属班次不分页
export function listShift(query) {
  return request({
     url: '/sm/schedule/shift/getlist',
     method: 'get',
     params: query
   })
 }

// 所属团队不分页
export function listTeam(query) {
  return request({
    url: '/sm/member/team/getlist',
    method: 'get',
    params: query
  })
}